<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>微擎示例应用</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">

    <link rel="stylesheet" type="text/css" href="/addons/we7_thinkphp/public/static/style/module/css/font/iconfont.css?v=1.0.1" media="all">
    <link rel="stylesheet" type="text/css" href="/addons/we7_thinkphp/public/static/plug/layui/css/layui.css?v=2.2.2" media="all">
    <link rel="stylesheet" type="text/css" href="/addons/we7_thinkphp/public/static/style/module/css/main.css?v2.0.1-simple" media="all">
    <script type="text/javascript" src="/addons/we7_thinkphp/public/static/plug/layui/layui.js?v=2.2.2"></script>
    <script type="text/javascript" src="/addons/we7_thinkphp/public/static/style/module/js/common.js?v=2.0.1"></script>
    <script type="text/javascript" src="/addons/we7_thinkphp/public/static//common/js/jquery-3.3.1.min.js"></script>
    <script src="/addons/we7_thinkphp/public/static/plug/qiniu/qiniu.min.js"></script>
    <script type="text/javascript" src="/addons/we7_thinkphp/public/static/common/js/function.js"></script>
    <style>
        #filelist .showimg{ height: 120px; overflow: hidden ; float:left; width: 140px; margin: 5px; border-radius: 5px; padding: 3px; border: 1px solid  #efefef; cursor: pointer}
        #filelist .showimg .img { height: 120px; }
        .checks{ position: absolute}
        #filelist .showimg p{ background-color: #000000; opacity:0.8;color: #FFFFFF; line-height: 25px; margin-top: -25px;width: 140px; position:absolute;display: inline-bloc; overflow: hidden; text-align: center}
        #filelist img{width:100%; height: 100%}
        #neifilelist .showimg{ height: 120px; overflow: hidden ; float:left; width: 140px; margin: 5px; border-radius: 5px; padding: 3px; border: 1px solid  #efefef; cursor: pointer}
        #neifilelist .showimg .img { height: 120px; }
        #neifilelist .showimg p{ background-color: #000000; opacity:0.8;color: #FFFFFF; line-height: 25px; margin-top: -25px;width: 140px; position:absolute;display: inline-bloc; overflow: hidden; text-align: center}
        #neifilelist img{width:100%;}
        .imgurls{ width:200px; height: 150px; overflow: hidden; border: 1px #5A5A5A solid;  margin: 10px auto;}
        .imgurls img{max-height: 200px; max-width: 200px;}
        #uploads{ width: 90%; margin: 0 auto}
        #link{ font-size: 14px; line-height: 30px; padding-bottom: 10px; margin-top: 20px; border-bottom: 1px #BCBCBC dashed}
        #link span{ cursor: pointer; color: #008A18}
        #show_pro{  padding-left: 50px;}
    </style>
</head>
<body>
<div class="layui-fluid larry-wrapper">
    <div class="layui-row layui-col-space30">
        <div class="layui-col-xs12">
            <section class="panel panel-padding">
                <form id="form1" class="layui-form" lay-filter="addMenu"  action="./index.php?c=site&a=entry&m=we7_thinkphp&do=article&act=article_add" method="POST">
                    <div class="layui-tab" lay-filter="check">
                        <ul class="layui-tab-title">
                            <li class="layui-this" lay-id="1">编辑文章</li>
                        </ul>
                        <div class="layui-tab-content">
                            <div class="layui-tab-item layui-show">
                                <input type="hidden" name="id" value="{$article_info['id']}">
                                <div class="layui-form-item">
                                    <label class="layui-form-label">标题</label>
                                    <div class="layui-input-block">
                                        <input name="title" id="title" type="text"  class="layui-input " value="{$article_info['title']}" required lay-verify="title" placeholder="请输入标题" style="width: 60%;">
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">作者</label>
                                    <div class="layui-input-block">
                                        <input name="aouth" id="aouth" type="text"  class="layui-input " value="{$article_info['aouth']}" required lay-verify="title" placeholder="请输入作者" style="width: 60%;">
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">简介</label>
                                    <div class="layui-input-block">
                                        <textarea id="description" name="description" type="text/plain" style="width:99%;height:100px" placeholder="请输入简介">{$article_info['description']}</textarea>
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">内容</label>
                                    <div class="layui-input-block">
                                        <textarea id="article" name="article" type="text/plain" style="width:99%;height:200px" placeholder="请输入内容">{$article_info['article']}</textarea>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button class="layui-btn" lay-submit lay-filter="*">编辑</button>
                            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                        </div>
                    </div>
                </form>
            </section>
        </div>
    </div>
</div>
<div id='showdiv' style="display:none;"></div>
</body>

<script>

    layui.config({
        base: '/addons/we7_thinkphp/public/static/style/module/js/',
        version: "2.0.1-simple"
    }).extend({
        jqelem: 'jqmodules/jqelem',
        jqmenu: 'jqmodules/jqmenu',
        tabmenu: 'jqmodules/tabmenu',
        jqtags: 'jqmodules/jqtags',
        jqform: 'jqmodules/jqform',
        jqcitys: "jqmodules/jqcitys",
        treeSelect: 'jqmodules/treeSelect',
        jqbind: "jqmodules/jqbind"
    })
    layui.use('laydate', function(){
        var laydate = layui.laydate;
    });

    layui.use(['jquery','jqbind', 'jqtags', 'jqform', 'upload','layedit','treeSelect'],function(){
        var $ = layui.jquery,
            form = layui.form,
            treeSelect = layui.treeSelect,
            jqtags = layui.jqtags;
        jqtags.init();
        var layedit = layui.layedit;

        form.on('submit(*)', function(data){
            url = "./index.php?c=site&a=entry&m=we7_thinkphp&do=article&act=article_edit";
            $.post(url,data.field,function(res){
                if(res.code == 0)
                {
                    layer.msg(res.msg);
                    var index = parent.layer.getFrameIndex(window.name);
                    parent.layer.close(index);

                    parent.layui.table.reload('article', {
                        page: {
                            curr: 1
                        }
                    });
                }
                else
                {
                    layer.msg(res.msg);
                }
            }, "json");
            return false;
        });
    })

</script>

</html>